home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Scripting 2882110132001.psc / snipplets / example.txt < prev    next >
Encoding:
Text File  |  2001-10-11  |  1.0 KB  |  41 lines

  1. alias leftof
  2.   return [left $1 [dec [instr $1 $2]]]
  3. end alias
  4.  
  5. alias rightof
  6.   return [mid $1 [inc [instr $1 $2]]]
  7. end alias
  8.  
  9. alias main
  10.   # This is a
  11.     multi-lined comment
  12.   #
  13.   ; This is a single line comment
  14.   msg "This is a basic msgbox"
  15.   msg "This has a caption" "Caption"
  16.   msg "This has a caption and a type" "Caption" 64 # 64 = info #
  17.  
  18.   ; set command
  19.   set variablename "Hello World"
  20.   msg "$variablename!" "First SEX Script"
  21.  
  22.   set fullname [input "What is your full name?" "Full name?"]
  23.   if [instr $fullname Gates]
  24.     msg "Are you related to Bill Gates by any change? "Related?" 36
  25.   else
  26.     msg "Nice to meet you, $fullname!"
  27.   end if
  28.  
  29.   loop x 3
  30.     loop y 3
  31.       msg "coords: $x,$y" "coordinates" 64
  32.     end loop
  33.   end loop
  34.  
  35.   set firstlastname [input "Now please enter your first and last name" "Name?"]
  36.   set firstname [leftof $firstlastname " "]
  37.   set lastname [rightof $firstlastname " "]
  38.  
  39.   msg "Your first name is: $firstname\nYour last name is: $lastname\n"
  40. end alias
  41.